import static org.junit.Assert.*;

import org.junit.Test;


public class BlockTest {

	@Test
	public void encrypt() {
		//--------------------------------------------------------------------------
		//--------------------------------------------------------------------------
		//Encryption
//		Block block = new Block("3243f6a8885a308d313198a2e0370734", 
//								"2b7e151628aed2a6abf7158809cf4f3c");
//		String encrypted = block.cipher();
//		String expected = "3925841d02dc09fbdc118597196a0b32";
//		assertTrue(encrypted.equals(expected));
//		
//		block = new Block("00112233445566778899aabbccddeeff", 
//				"000102030405060708090a0b0c0d0e0f");
//		encrypted = block.cipher();
//		expected = "69c4e0d86a7b0430d8cdb78070b4c55a";
//		assertTrue(encrypted.equals(expected));
//		
//		block = new Block("00112233445566778899aabbccddeeff", 
//				"000102030405060708090a0b0c0d0e0f1011121314151617");
//		encrypted = block.cipher();
//		expected = "dda97ca4864cdfe06eaf70a0ec0d7191";
//		assertTrue(encrypted.equals(expected));
		
		Block block = new Block("00112233445566778899aabbccddeeff", 
				"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f");
		String encrypted = block.cipher();
		String expected = "8ea2b7ca516745bfeafc49904b496089";
		assertTrue(encrypted.equals(expected));
		
		//--------------------------------------------------------------------------
		//--------------------------------------------------------------------------
		//Decryption
		
//		block = new Block("3925841d02dc09fbdc118597196a0b32", 
//				"2b7e151628aed2a6abf7158809cf4f3c");
//		expected = "3243f6a8885a308d313198a2e0370734";
//		assertTrue(expected.equals(block.invCipher()));
//		
//		block = new Block("69c4e0d86a7b0430d8cdb78070b4c55a", 
//				"000102030405060708090a0b0c0d0e0f");
//		expected = "00112233445566778899aabbccddeeff";
//		assertTrue(expected.equals(block.invCipher()));
//		
//		block = new Block("dda97ca4864cdfe06eaf70a0ec0d7191", 
//				"000102030405060708090a0b0c0d0e0f1011121314151617");
//		expected = "00112233445566778899aabbccddeeff";
//		assertTrue(expected.equals(block.invCipher()));
		
		block = new Block("8ea2b7ca516745bfeafc49904b496089", 
				"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f");
		expected = "00112233445566778899aabbccddeeff";
		assertTrue(expected.equals(block.invCipher()));
	}

}
